<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/include/taglib.jsp"%>
<html>
<head>
<meta charset="UTF-8">
<title>余额宝详情</title>
<jsp:include page="/include/wchat/head.jsp"></jsp:include>

<link type="text/css" rel="stylesheet" href="/v2/wchat/resrc/css/account.css">
</head>
<style>
.table .items{padding:0;}
</style>
<body>
<div id="header"> <a href="/getYebInvestorRecord.do" class="backto">返回</a>
  <div class="title-sub">余额宝详情</div>
</div>
<div id="wrap">
  <div class="table invest-tb yeb-invest">
    <div class="model-box loan-parame">
					<div class="head">
						<strong> 余额宝${map.SN } </strong>
						<div class="r">
						</div>
					</div>
					<div class="loan-parame-post">
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">投资金额</span>

							</li>
							<li>
							￥
								<fmt:formatNumber value="${map.investAmount}"
									pattern="#,##0.00#" />
							</li>
						</ul>
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">冻结赎回金额</span>
							</li>
							<li>
							￥
								<fmt:formatNumber value="${map.freezeAmount}"
									pattern="#,##0.00#" />
							</li>
						</ul>
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">年化收益率</span>
							</li>
							<li>
							<span class="light-org">${map.annualRate}%</span>
							</li>
						</ul>
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">已赎回金额</span>
							</li>
							<li>
							￥
								<fmt:formatNumber value="${map.hasRedeemAmount}"
									pattern="#,##0.00#" />
							</li>
						</ul>

						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">累计收益</span>								
							</li>
							<li>
							<span class="light-org">￥${map.interestSum }</span>
							</li>
						</ul>
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">计息日期</span>								
							</li>
							<li>
							<s:if test="#request.map.status == 1">----</s:if>
								<s:else>${map.interestDay }</s:else>
							</li>
						</ul>
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">昨日收益</span>								
							</li>
							<li>
							<span class="light-org">￥${map.dailyInterest }</span>
							</li>
						</ul>
						<ul class="items">
							<li class="yeb_l_bg">
								<span class="tit">状态</span>								
							</li>
							<li>
							<s:if test="#request.map.status == 1">申请期</s:if>
								<s:elseif test="#request.map.status == 2">计息期</s:elseif>
								<s:elseif test="#request.map.status == 3">用户赎回已申请</s:elseif>
								<s:elseif test="#request.map.status == 4">用户赎回处理中</s:elseif>
								<s:elseif test="#request.map.status == 5">已赎回</s:elseif>
								<s:elseif test="#request.map.status == 6">用户赎回处理中</s:elseif><!-- 到期的借款赎回处理状态 -->
								<s:elseif test="#request.map.status == 7">到期已轮转</s:elseif>
							</li>
						</ul>
					</div>
				</div>
    	
  </div>
  
  <div class="title-items">
					<h2>
						余额宝近一周收益
					</h2>
					<b class="line"></b>
				</div>
				<div id="paramePer"></div>


				
				<div class="plan-stats r3">
					统计数据：本余额宝共含借款项目
					<em id="planIncludeProjCount2">1</em> 个，总金额
					<em><fmt:formatNumber value="${map.investAmount}"
							pattern="#,##0.00#" />
					</em> 元，资金利用率
					<em>100.00%</em>
				</div>
</div>
<form id="pageSearchForm" name="pageSearchForm" action="" method="post"></form>
<jsp:include page="/include/wchat/footer.jsp"></jsp:include>
<script src="/v2/local/js/chart/highcharts.js"></script>
		<script src="/v2/local/js/chart/exporting.js"></script>
		<script type="text/javascript" src="/v2/local/js/common/page.js"></script>
		<script type="text/javascript">
		$(function () {
		var strXX=[];
		var strYY=[];
		  var param = {};
			 $.ajax({
				dataType: 'json',
				url: environment.basePath+"/yeb7daysTotalRevenue.do?investId="+${param.id},
				data: param,
				type: 'POST',
				beforeSend: function(){
				},
				success: function(data) {
					var list = data.ylb7DaysIncomeList;
					var strX="";
					var strY="";
					for(var i=0,len=list.length;i<len;i++){
			            var strRq = list[i].rq;
			            var strInterestSum=list[i].InterestSum;
			            strXX.push(strRq);
			            strYY.push(strInterestSum);
		       		 }
		      		yebCharts(strXX,strYY);
		       		 	 
				},
				error: function() {
					alert("失败");
				}
			});
			
			
	    
		}
		);
		
		function yebCharts(strXX ,strYY){
		
		$('#paramePer').highcharts({
				chart: {
					type: 'line',//line
					marginTop:50
				},
				title: {
					text: '单位(元)',
					align: 'left',
					y: 10, 
					style:{color:'#475058'}
				},
				subtitle: {
					enabled: true
				},
				xAxis: {
					categories: strXX,
					labels: {
						align: 'center',
						rotation: 0,
						formatter: function() {
							return this.value// +'%'
						}
					}
				},
				yAxis: {
					//max: 10,
					min: 0,
					//tickInterval: 2, // X轴的步进值，决定隔多少个显示一个
					title: {
						enabled: false
					},
					labels: {
						//enabled: false,
						align: 'left', 
						x: -2,
						y: -8,
						formatter: function() {
							return this.value// +'%'
						}
					}
				},
				tooltip: {
					//enabled: false
					formatter: function() {
						return this.x +'余额宝累计收益:￥<b>'+ this.y +'</b>';
					}
				},
				plotOptions: {
					series: {
						compare: 'percent'
					},
					spline: {
						dataLabels: {
							enabled: false
						},
						lineWidth: 2,
						marker: {  
							enabled: false
						},
						states:{
							hover:{
								enabled:false,//鼠标放上去线的状态控制
								lineWidth:2
							}
						}
					},
					line: {
						dataLabels: {
							enabled: false
						},
						lineWidth: 2,
						marker: {  
							enabled: true 
						},
						states:{
							hover:{
								enabled:false,//鼠标放上去线的状态控制
								lineWidth:2
							}
						}
					}
				},
				legend: {
					enabled: false,
					layout: 'horizontal',
					align: 'top',
					verticalAlign: 'top',
					x: 70,
					y: -3,
					style:{color:'#f00'},
					borderWidth: 0
				},
				exporting: {
					enabled: false
				},
				credits: {enabled: false},
				series: [{
		            name: '余额宝收益',
		            data: strYY
		        }]
			});    
		}
		
</script>
</body>
</html>